package model;

import java.util.Set;

import utilities.Utilities;

public class HandChain extends AbstractChain {
	
	
	protected int lastActionPlayerSeat;
	protected Player dealerPlayer, bigBlindPlayer;
	
	public HandChain(){
		lastActionPlayerSeat = -1;		
	}	
	
	public void initializeSeats(int activeSeat){
		super.initializeActivePlayer(activeSeat);
		// Need to set the dealer player and big blind player now
		// because as the hand progress they may drop out.
		dealerPlayer = super.getDealerPlayer();
		bigBlindPlayer = getPlayer(super.getBigBlindPlayerSeat());
	}
	
	/**
	 * Get the last action player
	 * @return
	 */
	public int getLastActionPlayerSeat(){
		return lastActionPlayerSeat;
	}
	
	/**
	 * Set the last action player
	 * @param seat
	 */
	public void setLastActionPlayerSeat(int seat){
		this.lastActionPlayerSeat = seat;
	}	
		
	
	
	public HandChain copy(){
		HandChain other = new HandChain();
		
		Set<Integer> keys = map.keySet();
		for(Integer i : keys){
			other.addPlayer(i, map.get(i));			
		}
		return other;
	}
	
	public Player getDealerPlayer(){
		return dealerPlayer;
	}
	
	public Player getBigBlindPlayer(){
		return bigBlindPlayer;
	}
	
	
	
}
